//
//  DTItemCollectionViewCell.m
//  DanTang
//
//  Created by honeyrr on 2017/9/22.
//  Copyright © 2017年 honeyrr. All rights reserved.
//

#import "DTItemCollectionViewCell.h"

@interface DTItemCollectionViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *itemImage;
@property (weak, nonatomic) IBOutlet UILabel *itemTitle;
@property (weak, nonatomic) IBOutlet UILabel *itemPrice;
@property (weak, nonatomic) IBOutlet UIButton *itemLikesBtn;

@end

@implementation DTItemCollectionViewCell

-(void)setItems:(NSDictionary *)items
{
    _items = items;
    
    [_itemImage setImageWithURL:[NSURL URLWithString:items[@"cover_image_url"]] placeholderImage:[UIImage imageNamed:@"PlaceHolderImage_small_31x26_"]];
    _itemTitle.text = items[@"name"];
    _itemPrice.text = [NSString stringWithFormat:@"¥ %@",items[@"price"]];
    [_itemLikesBtn setTitle:[NSString stringWithFormat:@" %@ ",items[@"favorites_count"]] forState:UIControlStateNormal];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    //设置背景色
    self.backgroundColor = [UIColor whiteColor];
}

@end
